bitkeeper revision 1.1348 (4266ef9bSWLiNFi-ZJ_TkK7jYaRikA)
authoriap10@tetris.cl.cam.ac.uk <iap10@tetris.cl.cam.ac.uk>
Thu, 21 Apr 2005 00:11:07 +0000 (00:11 +0000)
committeriap10@tetris.cl.cam.ac.uk <iap10@tetris.cl.cam.ac.uk>
Thu, 21 Apr 2005 00:11:07 +0000 (00:11 +0000)
Truly round off the div result to get right PIT frequency for guest.
Otherwise, the guest's idea of time drifts away from that of the host.

Signed-off-by: Edwin Zhai <edwin.zhai@intel.com>
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
Signed-off-by: ian@xensource.com
xen/include/xen/lib.h

index fb809de82a5aa8517051c2da9521f3863ecf1d1d..d80bc4a4c16d92616507631eb630063b531072e4 100644 (file)
@@ -23,7 +23,7 @@
 #define SWAP(_a, _b) \
    do { typeof(_a) _t = (_a); (_a) = (_b); (_b) = _t; } while ( 0 )
 
-#define DIV_ROUND(x, y) (((x) + (y) - 1) / (y))
+#define DIV_ROUND(x, y) (((x) + (y) / 2) / (y))
 
 #define reserve_bootmem(_p,_l) ((void)0)